home *** CD-ROM | disk | FTP | other *** search
- property posH, posV, memName, mem, myRect, offsetH, offsetV, offdist, myAng
- global viewObj, mouseObj, world
-
- on new me, offH, offV, amemName
- offsetH = offH
- offsetV = offV
- offdist = getDistNum(0, 0, offH, offV)
- myAng = findAngle(0, 0, offH, offV)
- memName = "blank"
- mem = member(amemName)
- myRect = offset(mem.rect, offsetH, offsetV)
- return me
- end
-
- on draw me, sp, viewOffsetH, viewOffsetV
- set the member of sprite sp to mem
- temprect = offset(myRect, -viewOffsetH, -viewOffsetV)
- set the rect of sprite sp to mem.rect
- set the loc of sprite sp to point(temprect.left, temprect.top)
- sp = sp + 1
- return sp
- end
-
- on move me, h, v, ang
- temp = addang(ang, myAng)
- g = findMotion(temp)
- offsetH = getAt(g, 1) * offdist
- offsetV = getAt(g, 2) * offdist
- posH = h + offsetH
- posV = v + offsetV
- myRect = mem.rect
- myRect = offset(myRect, posH, posV)
- end
-
- on moveTo me, h, v
- posH = h
- posV = v
- myRect = offset(me.mem.rect, posH, posV)
- end
-